package ch.abcm.remsmobile.REMSMobile;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;
import ch.abcm.remsmobile.REMSMobile.network.NetworkController;
import ch.abcm.remsmobile.REMSMobile.network.networkutils.NetworkManager;
import ch.abcm.remsmobile.REMSMobile.network.networkutils.SSIDScanner;

public class HelloAndroidActivity extends Activity {

    private static final String TAG = "HelloAndroidActivity";

    /**
     * Called when the activity is first created.
     * 
     * @param savedInstanceState
     *            If the activity is being re-initialized after previously being
     *            shut down then this Bundle contains the data it most recently
     *            supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it
     *            is null.</b>
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(ch.abcm.remsmobile.REMSMobile.R.menu.main, menu);
        return true;
    }

    public void onButtonClick(View view) {
        switch (view.getId()) {
        case R.id.bu_main_repeat_status_update:
            sendBroadcast(new Intent(NetworkController.UPDATE_STATUS_ACTION));
            break;
        case R.id.bu_main_createAP:
            new NetworkManager(getApplicationContext()).createWiFiNetwork();
            break;
        }

    }

}
